import request from '@/utils/request'

export function getInventoryChannelByPage(query) {
  return request({
    url: '/mall/api/distributor/data-download/inventory/channel',
    method: 'get',
    params: query
  })
}

export function downloadInventory(param) {
  return request({
    url: '/mall/api/distributor/data-download/inventory/download',
    method: 'post',
    data: param,
    responseType: 'blob',
    timeout: 30000
  })
}

export function getRecommendationByPage(query) {
  return request({
    url: '/mall/api/distributor/data-download/recommendation',
    method: 'get',
    params: query
  })
}

export function downloadRecommendation(param) {
  return request({
    url: '/mall/api/distributor/data-download/recommendation/download',
    method: 'post',
    data: param,
    responseType: 'blob',
    timeout: 30000
  })
}

export function getDataPackageByPage(query) {
  return request({
    url: '/mall/api/distributor/data-download/data-package',
    method: 'get',
    params: query
  })
}

export function downloadDataPackage(param) {
  return request({
    url: '/mall/api/distributor/data-download/data-package/download',
    method: 'post',
    data: param,
    responseType: 'blob',
    timeout: 30000
  })
}

export function getGoodsByPage(query) {
  return request({
    url: '/mall/api/distributor/data-download/goods',
    method: 'get',
    params: query
  })
}

export function downloadGoods(param) {
  return request({
    url: '/mall/api/distributor/data-download/goods/download',
    method: 'post',
    data: param,
    responseType: 'blob',
    timeout: 30000
  })
}
